
import java.awt.Color;
import java.awt.Panel;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;



public class Janela extends JFrame{
    
    public Janela(){
        super("Minha Janela");
        super.setDefaultCloseOperation(EXIT_ON_CLOSE);
        super.setSize(300, 200);
        Panel p = new Panel();
        super.setVisible(true);
        p.add(new JLabel("POO"));
        p.add(new JButton("POO"));
        p.add(new JButton("POO2"));
        
       // super.getContentPane().setBackground(Color.red);
      //  super.getContentPane().add(new JLabel("POO"));
      //  super.getContentPane().add(new JButton("POO"));
      //  super.getContentPane().add(new JButton("POO2"));
        super.getContentPane().addMouseListener(new ManipuladorEvento());
        this.setContentPane(p);
    }
    asdsadj
    
    public static class ManipuladorEvento extends MouseAdapter{

        public void mouseClicked(MouseEvent me) {
           JOptionPane.showMessageDialog(null, "Mouse Clicado"); 
        }      
    }
    
    public static void main(String[] args){
        Janela j = new Janela();
    }
}
